Silk Mobile

Table of Contents (Homepage)

IBM RFT

You can run Silk Mobile scripts from IBM Rational (RFT). To do so, perform the following steps:

Step 1: Create a new Functional Test Project

Step 2: Set the project classpath:

  1. Open the project properties (right-click on the project)

  2. Select 'Java Build Path' and then the 'Libraries' tab:

    images/download/attachments/3310287/image2055.jpg
  3. Click on 'Add External JARs…

  4. In the Silk Mobile installation directory under client\java select all the JARs ( C:\Program Files\Silk\SilkMobile)

    images/download/attachments/3310287/image2056.jpg

Step 3: Create Helper Superclass:

  1. Go to File -> New -> Helper Superclass

    images/download/attachments/3310287/image2057.jpg
  2. Name the Superclass Silk Mobile Script and put it under a folder named 'mobile':

    images/download/attachments/3310287/image007.png
  3. Paste the code found under client\RFT\SeeTestScript.java file into the new Superclass

  4. Change the name of the first package from 'Resources' to the 'mobile'.

Step 4: Create a new Test

  1. Right-click on the test folder and select 'Add Empty Script', set the script name and click Next.

    images/download/attachments/3310287/image008.png
  2. Set the 'Helper Superclass' to the new superclass:

    images/download/attachments/3310287/image009.png

Step 5: Export code and Run script

  1. In Silk Mobile select 'RFT' as the code export environment and copy the script code:

    images/download/attachments/3310287/image011.jpg
  2. In RFT, in the newly created script right-click and select 'Insert Java Code Snippet'. You can set the name of the snippet

    images/download/attachments/3310287/image013.jpg
  3. Save the script.

  4. In the new script move to the 'Java' tab and paste the Silk Mobile-generated code into the ‘Add your code here’ location.

    images/download/attachments/3310287/image015.jpg
  5. Now you can run the test from RFT.

Step 6: After the execution finishes you should see the RFT html log with the Silk Mobile commands information:

images/download/attachments/3310287/image017.jpg